/*
 Navicat Premium Data Transfer

 Source Server         : DockerMysql5.7
 Source Server Type    : MySQL
 Source Server Version : 50744 (5.7.44)
 Source Host           : localhost:3306
 Source Schema         : db_class_activity

 Target Server Type    : MySQL
 Target Server Version : 50744 (5.7.44)
 File Encoding         : 65001

 Date: 19/04/2025 00:57:54
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_certificate
-- ----------------------------
DROP TABLE IF EXISTS `t_certificate`;
CREATE TABLE `t_certificate` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID   证书',
  `certificate_name` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '证数名称',
  `image` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '背景图片',
  `certification_nuit` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT '认证单位',
  `create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `is_deleted` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除：0代表未删除，1代表删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_certificate
-- ----------------------------
BEGIN;
INSERT INTO `t_certificate` (`id`, `certificate_name`, `image`, `certification_nuit`, `create_time`, `is_deleted`) VALUES (1, '测试证书', NULL, '测试证书认证单位', '2025-03-23 18:00:10', 0);
COMMIT;

-- ----------------------------
-- Table structure for t_certificate_user
-- ----------------------------
DROP TABLE IF EXISTS `t_certificate_user`;
CREATE TABLE `t_certificate_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID   证书与用户关系表',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `exam_id` int(11) DEFAULT NULL COMMENT '考试id',
  `code` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '证书编号',
  `certificate_id` int(11) DEFAULT NULL COMMENT '证书id',
  `create_time` datetime DEFAULT NULL COMMENT '获奖时间      YYYY-MM-DD hh:mm:ss',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_certificate_user
-- ----------------------------
BEGIN;
INSERT INTO `t_certificate_user` (`id`, `user_id`, `exam_id`, `code`, `certificate_id`, `create_time`) VALUES (1, 164, 4, 'EUKWxiqDQn3uJNzBv0', 1, '2025-03-23 18:01:23');
COMMIT;

-- ----------------------------
-- Table structure for t_discussion
-- ----------------------------
DROP TABLE IF EXISTS `t_discussion`;
CREATE TABLE `t_discussion` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL COMMENT '发布人id',
  `grade_id` int(11) NOT NULL COMMENT '接收班级id',
  `content` text NOT NULL COMMENT '内容',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `create_time` datetime NOT NULL COMMENT '发布时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_discussion
-- ----------------------------
BEGIN;
INSERT INTO `t_discussion` (`id`, `user_id`, `grade_id`, `content`, `title`, `create_time`) VALUES (1, 163, 124, '测试发布讨论 -内容1', '测试发布讨论 -标题1', '2025-04-04 17:55:10');
COMMIT;

-- ----------------------------
-- Table structure for t_exam
-- ----------------------------
DROP TABLE IF EXISTS `t_exam`;
CREATE TABLE `t_exam` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id    考试表',
  `title` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '考试名称',
  `exam_duration` int(11) NOT NULL COMMENT '考试时长',
  `passed_score` int(11) NOT NULL COMMENT '及格分',
  `gross_score` int(11) NOT NULL COMMENT '总分数',
  `max_count` int(11) DEFAULT NULL COMMENT '最大切屏次数',
  `user_id` int(11) DEFAULT NULL COMMENT '创建者id',
  `certificate_id` int(11) DEFAULT NULL COMMENT '证书id',
  `radio_count` int(11) DEFAULT NULL COMMENT '单选题数量',
  `radio_score` int(11) DEFAULT NULL COMMENT '单选题成绩     数据库存储*100，前端正常输入和展示/100',
  `multi_count` int(11) DEFAULT NULL COMMENT '多选题数量 ',
  `multi_score` int(11) DEFAULT NULL COMMENT '多选题成绩     数据库存储*100，前端正常输入和展示/100',
  `judge_count` int(11) DEFAULT NULL COMMENT '判断题数量 ',
  `judge_score` int(11) DEFAULT NULL COMMENT '判断题成绩     数据库存储*100，前端正常输入和展示/100',
  `saq_count` int(11) DEFAULT NULL COMMENT '简答题数量',
  `saq_score` int(11) DEFAULT NULL COMMENT '简答题成绩     数据库存储*100，前端正常输入和展示/100',
  `start_time` datetime DEFAULT NULL COMMENT '开始时间     YYYY-MM-DD hh:mm:ss',
  `end_time` datetime DEFAULT NULL COMMENT '结束时间     YYYY-MM-DD hh:mm:ss',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间     YYYY-MM-DD hh:mm:ss  ',
  `is_deleted` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除：0代表未删除，1代表删除',
  PRIMARY KEY (`id`,`passed_score`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_exam
-- ----------------------------
BEGIN;
INSERT INTO `t_exam` (`id`, `title`, `exam_duration`, `passed_score`, `gross_score`, `max_count`, `user_id`, `certificate_id`, `radio_count`, `radio_score`, `multi_count`, `multi_score`, `judge_count`, `judge_score`, `saq_count`, `saq_score`, `start_time`, `end_time`, `create_time`, `is_deleted`) VALUES (1, 'test', 100, 1, 2, 10, 163, NULL, 1, 2, 0, 0, 0, 0, 0, 0, '2025-03-18 16:00:00', '2025-04-29 16:00:00', '2025-03-23 13:44:24', 0);
INSERT INTO `t_exam` (`id`, `title`, `exam_duration`, `passed_score`, `gross_score`, `max_count`, `user_id`, `certificate_id`, `radio_count`, `radio_score`, `multi_count`, `multi_score`, `judge_count`, `judge_score`, `saq_count`, `saq_score`, `start_time`, `end_time`, `create_time`, `is_deleted`) VALUES (2, 'test2', 100, 2, 2, 100, 163, NULL, 1, 2, 0, 0, 0, 0, 0, 0, '2025-03-10 16:00:00', '2025-04-29 16:00:00', '2025-03-23 13:45:30', 0);
INSERT INTO `t_exam` (`id`, `title`, `exam_duration`, `passed_score`, `gross_score`, `max_count`, `user_id`, `certificate_id`, `radio_count`, `radio_score`, `multi_count`, `multi_score`, `judge_count`, `judge_score`, `saq_count`, `saq_score`, `start_time`, `end_time`, `create_time`, `is_deleted`) VALUES (3, 'test3', 100, 1, 4, 100, 163, NULL, 1, 2, 0, 0, 1, 2, 0, 0, '2025-03-12 16:00:00', '2025-04-29 16:00:00', '2025-03-23 17:58:52', 0);
INSERT INTO `t_exam` (`id`, `title`, `exam_duration`, `passed_score`, `gross_score`, `max_count`, `user_id`, `certificate_id`, `radio_count`, `radio_score`, `multi_count`, `multi_score`, `judge_count`, `judge_score`, `saq_count`, `saq_score`, `start_time`, `end_time`, `create_time`, `is_deleted`) VALUES (4, '测试证书获取', 100, 1, 5, 100, 163, 1, 1, 5, 0, 0, 0, 0, 0, 0, '2025-03-04 16:00:00', '2025-04-29 16:00:00', '2025-03-23 18:00:59', 0);
COMMIT;

-- ----------------------------
-- Table structure for t_exam_grade
-- ----------------------------
DROP TABLE IF EXISTS `t_exam_grade`;
CREATE TABLE `t_exam_grade` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id   考试与班级关系表',
  `exam_id` int(11) DEFAULT NULL COMMENT '考试id  唯一',
  `grade_id` int(11) DEFAULT NULL COMMENT '班级id  唯一',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_exam_grade
-- ----------------------------
BEGIN;
INSERT INTO `t_exam_grade` (`id`, `exam_id`, `grade_id`) VALUES (1, 1, 124);
INSERT INTO `t_exam_grade` (`id`, `exam_id`, `grade_id`) VALUES (2, 2, 124);
INSERT INTO `t_exam_grade` (`id`, `exam_id`, `grade_id`) VALUES (3, 3, 124);
INSERT INTO `t_exam_grade` (`id`, `exam_id`, `grade_id`) VALUES (4, 4, 124);
COMMIT;

-- ----------------------------
-- Table structure for t_exam_qu_answer
-- ----------------------------
DROP TABLE IF EXISTS `t_exam_qu_answer`;
CREATE TABLE `t_exam_qu_answer` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id  考试记录答案',
  `user_id` int(11) NOT NULL COMMENT '用户id',
  `exam_id` int(11) NOT NULL COMMENT '考试id',
  `question_id` int(11) NOT NULL COMMENT '试题id',
  `question_type` int(11) DEFAULT NULL COMMENT '题目类型',
  `answer_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '答案id  用于客观题，多选题id使用“，”分隔',
  `answer_content` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '答案内容    用于主观题',
  `checkout` int(11) DEFAULT NULL COMMENT '是否选中   0未选中  1选中',
  `is_sign` int(11) DEFAULT NULL COMMENT '是否标记   0未标记  1标记',
  `is_right` int(11) DEFAULT NULL COMMENT '是否正确   用于客观题，0错误 1正确',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `user_id` (`user_id`,`exam_id`,`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_exam_qu_answer
-- ----------------------------
BEGIN;
INSERT INTO `t_exam_qu_answer` (`id`, `user_id`, `exam_id`, `question_id`, `question_type`, `answer_id`, `answer_content`, `checkout`, `is_sign`, `is_right`) VALUES (1, 164, 1, 1, 1, '4', NULL, NULL, NULL, 0);
INSERT INTO `t_exam_qu_answer` (`id`, `user_id`, `exam_id`, `question_id`, `question_type`, `answer_id`, `answer_content`, `checkout`, `is_sign`, `is_right`) VALUES (2, 164, 4, 1, 1, '1', NULL, NULL, NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_exam_question
-- ----------------------------
DROP TABLE IF EXISTS `t_exam_question`;
CREATE TABLE `t_exam_question` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id  考试题目表',
  `exam_id` int(11) NOT NULL COMMENT '考试id',
  `question_id` int(11) NOT NULL COMMENT '题目id',
  `score` int(11) NOT NULL COMMENT '分值',
  `sort` int(11) DEFAULT NULL COMMENT '排序',
  `type` int(11) DEFAULT NULL COMMENT '试题类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_exam_question
-- ----------------------------
BEGIN;
INSERT INTO `t_exam_question` (`id`, `exam_id`, `question_id`, `score`, `sort`, `type`) VALUES (1, 1, 1, 2, 0, 1);
INSERT INTO `t_exam_question` (`id`, `exam_id`, `question_id`, `score`, `sort`, `type`) VALUES (2, 2, 1, 2, 0, 1);
INSERT INTO `t_exam_question` (`id`, `exam_id`, `question_id`, `score`, `sort`, `type`) VALUES (3, 3, 1, 2, 0, 1);
INSERT INTO `t_exam_question` (`id`, `exam_id`, `question_id`, `score`, `sort`, `type`) VALUES (4, 3, 2, 2, 1, 3);
INSERT INTO `t_exam_question` (`id`, `exam_id`, `question_id`, `score`, `sort`, `type`) VALUES (5, 4, 1, 5, 0, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_exam_repo
-- ----------------------------
DROP TABLE IF EXISTS `t_exam_repo`;
CREATE TABLE `t_exam_repo` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id  考试与题库',
  `exam_id` int(11) NOT NULL COMMENT '考试id  唯一',
  `repo_id` int(11) DEFAULT NULL COMMENT '题库id  唯一',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_exam_repo
-- ----------------------------
BEGIN;
INSERT INTO `t_exam_repo` (`id`, `exam_id`, `repo_id`) VALUES (1, 1, 1);
INSERT INTO `t_exam_repo` (`id`, `exam_id`, `repo_id`) VALUES (2, 2, 1);
INSERT INTO `t_exam_repo` (`id`, `exam_id`, `repo_id`) VALUES (3, 3, 1);
INSERT INTO `t_exam_repo` (`id`, `exam_id`, `repo_id`) VALUES (4, 4, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_exercise_record
-- ----------------------------
DROP TABLE IF EXISTS `t_exercise_record`;
CREATE TABLE `t_exercise_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `repo_id` int(11) NOT NULL COMMENT '题库id',
  `question_id` int(11) NOT NULL COMMENT '试题id',
  `user_id` int(11) NOT NULL COMMENT '用户id',
  `answer` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '主观题答案',
  `question_type` int(11) NOT NULL COMMENT '题目类型',
  `options` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '客观题答案集合  用于客观题,多选题id使用","分隔',
  `is_right` int(11) DEFAULT NULL COMMENT '客观题是否正确',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `repo_id` (`repo_id`,`question_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_exercise_record
-- ----------------------------
BEGIN;
INSERT INTO `t_exercise_record` (`id`, `repo_id`, `question_id`, `user_id`, `answer`, `question_type`, `options`, `is_right`) VALUES (1, 1, 1, 164, '2', 1, NULL, 0);
INSERT INTO `t_exercise_record` (`id`, `repo_id`, `question_id`, `user_id`, `answer`, `question_type`, `options`, `is_right`) VALUES (2, 1, 2, 164, '5', 3, NULL, 1);
INSERT INTO `t_exercise_record` (`id`, `repo_id`, `question_id`, `user_id`, `answer`, `question_type`, `options`, `is_right`) VALUES (3, 1, 3, 164, '8', 3, NULL, 0);
INSERT INTO `t_exercise_record` (`id`, `repo_id`, `question_id`, `user_id`, `answer`, `question_type`, `options`, `is_right`) VALUES (4, 1, 4, 164, '9', 3, NULL, 1);
INSERT INTO `t_exercise_record` (`id`, `repo_id`, `question_id`, `user_id`, `answer`, `question_type`, `options`, `is_right`) VALUES (5, 1, 5, 164, '11', 3, NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_grade
-- ----------------------------
DROP TABLE IF EXISTS `t_grade`;
CREATE TABLE `t_grade` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id   班级表',
  `grade_name` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '班级名称',
  `user_id` int(11) DEFAULT NULL COMMENT '创建人id',
  `code` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '班级口令',
  `is_deleted` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除：0代表未删除，1代表删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `grade_name` (`grade_name`) USING BTREE,
  UNIQUE KEY `code` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_grade
-- ----------------------------
BEGIN;
INSERT INTO `t_grade` (`id`, `grade_name`, `user_id`, `code`, `is_deleted`) VALUES (124, '测试班级', 1, 'OQPr7cXFdLxUPq0ZpJ', 0);
COMMIT;

-- ----------------------------
-- Table structure for t_grade_exercise
-- ----------------------------
DROP TABLE IF EXISTS `t_grade_exercise`;
CREATE TABLE `t_grade_exercise` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id  刷题表',
  `repo_id` int(11) DEFAULT NULL COMMENT '题库id',
  `grade_id` int(11) DEFAULT NULL COMMENT '班级id',
  `user_id` int(11) DEFAULT NULL COMMENT '创建人id',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_grade_exercise
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_job
-- ----------------------------
DROP TABLE IF EXISTS `t_job`;
CREATE TABLE `t_job` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `content` text COMMENT '作业详细内容',
  `user_id` int(11) NOT NULL COMMENT '创建作业id',
  `grade_id` int(11) NOT NULL COMMENT '作业所属班级',
  `is_deleted` int(255) DEFAULT '0' COMMENT '逻辑删除字段',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `start_time` datetime DEFAULT NULL COMMENT '创建时间',
  `end_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of t_job
-- ----------------------------
BEGIN;
INSERT INTO `t_job` (`id`, `title`, `content`, `user_id`, `grade_id`, `is_deleted`, `create_time`, `start_time`, `end_time`) VALUES (5, 'test', '<p>测试征文<img src=\"http://127.0.0.1:9000/online-exam/3d38e37f-301d-4b04-8fd6-d2952dc6a9ca.png\"></p>', 163, 124, 0, '2025-04-06 18:09:04', '2025-03-31 16:00:00', '2025-05-13 16:00:00');
INSERT INTO `t_job` (`id`, `title`, `content`, `user_id`, `grade_id`, `is_deleted`, `create_time`, `start_time`, `end_time`) VALUES (6, '测试过期作业', '<p>测试过期作业</p>', 163, 124, 1, '2025-04-06 20:12:08', '2025-03-31 16:00:00', '2025-05-01 16:00:00');
INSERT INTO `t_job` (`id`, `title`, `content`, `user_id`, `grade_id`, `is_deleted`, `create_time`, `start_time`, `end_time`) VALUES (7, '测试过期', '<p>测试过期</p>', 163, 124, 0, '2025-04-06 20:12:34', '2025-04-10 16:00:00', '2025-05-21 16:00:00');
INSERT INTO `t_job` (`id`, `title`, `content`, `user_id`, `grade_id`, `is_deleted`, `create_time`, `start_time`, `end_time`) VALUES (8, '测试尚未开始', '<p>测试尚未开始</p>', 163, 124, 0, '2025-04-06 20:12:58', '2025-03-31 16:00:00', '2025-04-04 16:00:00');
INSERT INTO `t_job` (`id`, `title`, `content`, `user_id`, `grade_id`, `is_deleted`, `create_time`, `start_time`, `end_time`) VALUES (9, 'dafsdf', '<p>abcdsdfasdfasdfasdf</p>', 163, 124, 0, '2025-04-06 20:27:51', '2025-04-02 00:00:00', '2025-05-21 00:00:00');
COMMIT;

-- ----------------------------
-- Table structure for t_like
-- ----------------------------
DROP TABLE IF EXISTS `t_like`;
CREATE TABLE `t_like` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `discussion_id` int(11) DEFAULT NULL,
  `reply_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `discussion_id` (`discussion_id`,`reply_id`,`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of t_like
-- ----------------------------
BEGIN;
INSERT INTO `t_like` (`id`, `discussion_id`, `reply_id`, `user_id`, `create_time`) VALUES (6, 1, 8, 163, '2025-04-18 00:36:58');
INSERT INTO `t_like` (`id`, `discussion_id`, `reply_id`, `user_id`, `create_time`) VALUES (10, 1, 9, 163, '2025-04-18 17:51:06');
INSERT INTO `t_like` (`id`, `discussion_id`, `reply_id`, `user_id`, `create_time`) VALUES (11, 1, 12, 163, '2025-04-18 17:51:08');
COMMIT;

-- ----------------------------
-- Table structure for t_log
-- ----------------------------
DROP TABLE IF EXISTS `t_log`;
CREATE TABLE `t_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `place` varchar(255) NOT NULL COMMENT '登录地点',
  `behavior` varchar(255) NOT NULL COMMENT '操作行为',
  `device` varchar(255) NOT NULL COMMENT '登录设备',
  `user_id` int(11) NOT NULL COMMENT '创建人',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1481613391 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of t_log
-- ----------------------------
BEGIN;
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-04 15:57:38');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (2, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-04 15:59:49');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (3, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-04 16:05:40');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (4, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-04 16:05:47');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613319, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 1, '2025-04-04 16:07:07');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613320, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-04 16:07:17');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613321, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 1, '2025-04-04 16:11:55');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613322, '0|0|0|内网IP|内网IP', '登录失败', 'Macintosh', 1, '2025-04-04 16:13:10');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613323, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-04 16:13:17');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613324, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 1, '2025-04-04 16:15:47');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613325, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-04 16:15:54');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613326, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-04 16:16:03');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613327, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-04 16:16:10');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613328, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-04 17:59:08');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613329, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-04 17:59:14');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613330, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-04 21:40:02');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613331, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-04 22:21:57');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613332, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-04 22:22:09');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613333, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-04 22:22:47');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613334, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-04 22:22:54');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613335, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-04 23:06:05');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613336, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-04 23:06:20');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613337, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-04 23:06:34');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613338, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-04 23:06:42');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613339, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-04 23:07:43');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613340, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-05 00:03:04');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613341, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-05 00:03:45');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613342, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-05 00:03:53');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613343, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-05 09:23:35');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613344, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-05 09:31:58');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613345, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-05 09:32:05');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613346, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-05 09:44:49');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613347, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-05 09:45:10');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613348, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-05 09:45:52');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613349, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-05 09:46:04');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613350, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-06 15:06:00');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613351, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 1, '2025-04-06 15:06:52');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613352, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-06 15:07:06');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613353, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 1, '2025-04-06 15:07:18');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613354, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-06 15:07:28');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613355, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-06 16:48:05');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613356, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-06 16:48:17');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613357, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-06 16:55:03');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613358, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-06 16:55:11');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613359, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-06 16:58:59');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613360, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-06 16:59:09');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613361, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-06 17:51:39');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613362, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-06 17:51:48');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613363, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-06 18:08:42');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613364, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-06 18:09:24');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613365, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-06 18:09:34');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613366, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-06 20:00:43');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613367, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-06 20:09:56');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613368, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-06 20:10:05');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613369, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-06 20:10:24');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613370, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-06 20:10:32');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613371, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-06 20:11:38');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613372, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-06 20:11:46');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613373, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-06 20:13:00');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613374, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-06 20:13:08');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613375, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-06 20:14:14');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613376, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-06 20:14:21');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613377, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-06 20:41:00');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613378, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-06 20:41:08');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613379, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 1, '2025-04-06 20:41:53');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613380, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-06 20:41:59');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613381, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-06 20:42:08');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613382, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-06 20:42:14');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613383, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 1, '2025-04-06 20:44:50');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613384, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 1, '2025-04-06 20:44:57');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613385, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-17 22:23:14');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613386, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-18 17:48:01');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613387, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 163, '2025-04-18 17:54:41');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613388, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 164, '2025-04-18 17:54:49');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613389, '0|0|0|内网IP|内网IP', '设备登出', 'Macintosh', 164, '2025-04-18 17:55:24');
INSERT INTO `t_log` (`id`, `place`, `behavior`, `device`, `user_id`, `create_time`) VALUES (1481613390, '0|0|0|内网IP|内网IP', '设备登录', 'Macintosh', 163, '2025-04-18 17:55:31');
COMMIT;

-- ----------------------------
-- Table structure for t_manual_score
-- ----------------------------
DROP TABLE IF EXISTS `t_manual_score`;
CREATE TABLE `t_manual_score` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id   人工评分表',
  `exam_qu_answer_id` int(11) DEFAULT NULL COMMENT '考试记录答案id',
  `user_id` int(11) DEFAULT NULL COMMENT '批改人id',
  `score` int(11) DEFAULT NULL COMMENT '得分',
  `create_time` datetime DEFAULT NULL COMMENT '批改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_manual_score
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_notice
-- ----------------------------
DROP TABLE IF EXISTS `t_notice`;
CREATE TABLE `t_notice` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID   公告表',
  `title` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '公告标题',
  `image` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '图片地址',
  `content` text COLLATE utf8mb4_bin NOT NULL COMMENT '公告内容',
  `user_id` int(11) DEFAULT NULL COMMENT '创建用户ID   唯一',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `is_deleted` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除：0代表未删除，1代表删除',
  `is_public` int(11) DEFAULT NULL COMMENT '是否公开所有用户，老师为所有班级，管理员为所有用户',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_notice
-- ----------------------------
BEGIN;
INSERT INTO `t_notice` (`id`, `title`, `image`, `content`, `user_id`, `create_time`, `is_deleted`, `is_public`) VALUES (1, '测试公告公开', NULL, '<p>测试公告公开</p>', 163, '2025-03-23 17:57:55', 0, 1);
INSERT INTO `t_notice` (`id`, `title`, `image`, `content`, `user_id`, `create_time`, `is_deleted`, `is_public`) VALUES (2, '测试公告不公开', NULL, '<p>测试公告不公开</p>', 163, '2025-03-23 17:58:05', 0, 0);
INSERT INTO `t_notice` (`id`, `title`, `image`, `content`, `user_id`, `create_time`, `is_deleted`, `is_public`) VALUES (3, 'admin测试公告', NULL, '<p>admin测试公告</p>', 1, '2025-03-23 17:59:59', 0, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_notice_grade
-- ----------------------------
DROP TABLE IF EXISTS `t_notice_grade`;
CREATE TABLE `t_notice_grade` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID   公告班级关联表',
  `notice_id` int(11) DEFAULT NULL COMMENT '公告id',
  `grade_id` int(11) DEFAULT NULL COMMENT '班级',
  `is_deleted` int(11) DEFAULT '0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_notice_grade
-- ----------------------------
BEGIN;
INSERT INTO `t_notice_grade` (`id`, `notice_id`, `grade_id`, `is_deleted`) VALUES (1, 2, 124, 0);
COMMIT;

-- ----------------------------
-- Table structure for t_option
-- ----------------------------
DROP TABLE IF EXISTS `t_option`;
CREATE TABLE `t_option` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id   选项答案表',
  `qu_id` int(11) NOT NULL COMMENT '试题id',
  `is_right` int(11) DEFAULT NULL COMMENT '是否正确',
  `image` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '图片地址   0错误 1正确',
  `content` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '选项内容',
  `sort` int(11) DEFAULT NULL COMMENT '排序',
  `is_deleted` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除：0代表未删除，1代表删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_option
-- ----------------------------
BEGIN;
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (1, 1, 1, NULL, '测试单选题答案', 0, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (2, 1, 0, NULL, '测试单选题选项1', 1, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (3, 1, 0, NULL, '测试单选题选项2', 2, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (4, 1, 0, NULL, '测试单选题选项3', 3, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (5, 2, 1, NULL, '正确', 0, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (6, 2, 0, NULL, '错误', 1, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (7, 3, 1, NULL, '正确', 0, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (8, 3, 0, NULL, '错误', 1, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (9, 4, 1, NULL, '正确', 0, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (10, 4, 0, NULL, '错误', 1, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (11, 5, 1, NULL, '正确', 0, 0);
INSERT INTO `t_option` (`id`, `qu_id`, `is_right`, `image`, `content`, `sort`, `is_deleted`) VALUES (12, 5, 0, NULL, '错误', 1, 0);
COMMIT;

-- ----------------------------
-- Table structure for t_question
-- ----------------------------
DROP TABLE IF EXISTS `t_question`;
CREATE TABLE `t_question` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id   试题表',
  `qu_type` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '试题类型',
  `image` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '试题图片',
  `content` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '题干',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `analysis` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '题目分析',
  `repo_id` int(11) DEFAULT NULL COMMENT '题库id',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `is_deleted` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除：0代表未删除，1代表删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_question
-- ----------------------------
BEGIN;
INSERT INTO `t_question` (`id`, `qu_type`, `image`, `content`, `create_time`, `analysis`, `repo_id`, `user_id`, `is_deleted`) VALUES (1, '1', NULL, '测试单选题', '2025-03-23 13:32:55', NULL, 1, 163, 0);
INSERT INTO `t_question` (`id`, `qu_type`, `image`, `content`, `create_time`, `analysis`, `repo_id`, `user_id`, `is_deleted`) VALUES (2, '3', NULL, '测试判断题', '2025-03-23 17:58:20', NULL, 1, 163, 0);
INSERT INTO `t_question` (`id`, `qu_type`, `image`, `content`, `create_time`, `analysis`, `repo_id`, `user_id`, `is_deleted`) VALUES (3, '3', NULL, '111', '2025-03-27 22:19:57', NULL, 1, 163, 0);
INSERT INTO `t_question` (`id`, `qu_type`, `image`, `content`, `create_time`, `analysis`, `repo_id`, `user_id`, `is_deleted`) VALUES (4, '3', NULL, '2222', '2025-03-27 22:20:06', NULL, 1, 163, 0);
INSERT INTO `t_question` (`id`, `qu_type`, `image`, `content`, `create_time`, `analysis`, `repo_id`, `user_id`, `is_deleted`) VALUES (5, '3', NULL, '3333', '2025-03-27 22:20:14', NULL, 1, 163, 0);
COMMIT;

-- ----------------------------
-- Table structure for t_reply
-- ----------------------------
DROP TABLE IF EXISTS `t_reply`;
CREATE TABLE `t_reply` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `discussion_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `parent_id` int(11) DEFAULT NULL COMMENT '父评论id',
  `content` varchar(255) NOT NULL,
  `create_time` datetime NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_reply
-- ----------------------------
BEGIN;
INSERT INTO `t_reply` (`id`, `discussion_id`, `user_id`, `parent_id`, `content`, `create_time`) VALUES (8, 1, 163, -1, '111212121', '2025-04-04 21:28:06');
INSERT INTO `t_reply` (`id`, `discussion_id`, `user_id`, `parent_id`, `content`, `create_time`) VALUES (9, 1, 163, -1, '委屈二分身乏术', '2025-04-04 21:29:30');
INSERT INTO `t_reply` (`id`, `discussion_id`, `user_id`, `parent_id`, `content`, `create_time`) VALUES (10, 1, 163, -1, '111', '2025-04-04 21:57:00');
INSERT INTO `t_reply` (`id`, `discussion_id`, `user_id`, `parent_id`, `content`, `create_time`) VALUES (12, 1, 164, -1, '2223213', '2025-04-04 22:13:05');
INSERT INTO `t_reply` (`id`, `discussion_id`, `user_id`, `parent_id`, `content`, `create_time`) VALUES (18, 1, 163, 12, '测试评论', '2025-04-05 09:46:47');
COMMIT;

-- ----------------------------
-- Table structure for t_repo
-- ----------------------------
DROP TABLE IF EXISTS `t_repo`;
CREATE TABLE `t_repo` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id   题库表',
  `user_id` int(11) NOT NULL COMMENT '创建人id',
  `title` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '题库标题',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `is_deleted` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除：0代表未删除，1代表删除',
  `is_exercise` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_repo
-- ----------------------------
BEGIN;
INSERT INTO `t_repo` (`id`, `user_id`, `title`, `create_time`, `is_deleted`, `is_exercise`) VALUES (1, 163, '测试题库', '2025-03-23 13:32:27', 0, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID  角色表',
  `role_name` varchar(10) COLLATE utf8mb4_bin NOT NULL COMMENT '角色名称',
  `code` varchar(10) COLLATE utf8mb4_bin NOT NULL COMMENT '角色编码',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_role
-- ----------------------------
BEGIN;
INSERT INTO `t_role` (`id`, `role_name`, `code`) VALUES (1, '学生', 'student');
INSERT INTO `t_role` (`id`, `role_name`, `code`) VALUES (2, '教师', 'teacher');
INSERT INTO `t_role` (`id`, `role_name`, `code`) VALUES (3, '管理员', 'admin');
COMMIT;

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `user_name` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '用户名',
  `real_name` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '真实姓名',
  `password` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '密码',
  `avatar` varchar(255) COLLATE utf8mb4_bin DEFAULT 'https://online-exam-system-backend.oss-cn-beijing.aliyuncs.com/da93c2a6-6879-46c3-b38f-a99956f70d22.jpg' COMMENT '头像地址',
  `role_id` int(11) DEFAULT '1' COMMENT '角色id',
  `grade_id` int(11) DEFAULT NULL COMMENT '班级id',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间   YYYY-MM-DD hh:mm:ss',
  `status` int(11) DEFAULT '1' COMMENT '状态  1正常0禁用',
  `is_deleted` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除：0代表未删除，1代表删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `user_name` (`user_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=167 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_user
-- ----------------------------
BEGIN;
INSERT INTO `t_user` (`id`, `user_name`, `real_name`, `password`, `avatar`, `role_id`, `grade_id`, `create_time`, `status`, `is_deleted`) VALUES (1, 'admin', '管理员', '$2a$10$/ZdKFY15AWNLOeTqAp91a.uDa0JDioj1wVYGgpn.HKMYh9vq0Uh4S', 'https://online-exam-system-backend.oss-cn-beijing.aliyuncs.com/27eb3a59-4d05-4bce-90ec-4a2457452886.png', 3, 106, '2024-05-23 16:06:07', 1, 0);
INSERT INTO `t_user` (`id`, `user_name`, `real_name`, `password`, `avatar`, `role_id`, `grade_id`, `create_time`, `status`, `is_deleted`) VALUES (163, 'teacher', '教师测试账号', '$2a$10$odROzQ2vFaHRomD9UG4uWO65twiqI33Y1RktzqtxWNLaVf5.luivy', 'https://online-exam-system-backend.oss-cn-beijing.aliyuncs.com/da93c2a6-6879-46c3-b38f-a99956f70d22.jpg', 2, NULL, '2025-03-22 11:38:18', 1, 0);
INSERT INTO `t_user` (`id`, `user_name`, `real_name`, `password`, `avatar`, `role_id`, `grade_id`, `create_time`, `status`, `is_deleted`) VALUES (164, 'student', '学生测试账号', '$2a$10$vcnsGkVJdeH0tdKiLa1.d.qbPD/.5B5Ah3qYzeN6rem5P/U8jGiMS', 'http://127.0.0.1:9000/online-exam/9556ccd1-f55a-41fe-8b3e-93169c0e3614.jpeg', 1, 124, '2025-03-22 11:38:36', 1, 0);
INSERT INTO `t_user` (`id`, `user_name`, `real_name`, `password`, `avatar`, `role_id`, `grade_id`, `create_time`, `status`, `is_deleted`) VALUES (165, 'testgrade', '测试学生新建并加入班级', '$2a$10$nYj3nStk/Xe.01ndD7FbKu1w2FGvU6Jy9DwRFCzdiOTy4VhcZjuiu', 'https://online-exam-system-backend.oss-cn-beijing.aliyuncs.com/da93c2a6-6879-46c3-b38f-a99956f70d22.jpg', 1, 124, '2025-03-25 20:14:25', 1, 0);
INSERT INTO `t_user` (`id`, `user_name`, `real_name`, `password`, `avatar`, `role_id`, `grade_id`, `create_time`, `status`, `is_deleted`) VALUES (166, 'test2', 'test2', '$2a$10$3q4c5XkZjf4F4uomH7nGAuwhcdEL9bPee11SuEh93q0dtq3RgT78e', 'https://online-exam-system-backend.oss-cn-beijing.aliyuncs.com/da93c2a6-6879-46c3-b38f-a99956f70d22.jpg', 1, NULL, '2025-03-25 20:17:14', 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_user_book
-- ----------------------------
DROP TABLE IF EXISTS `t_user_book`;
CREATE TABLE `t_user_book` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID   错题本',
  `exam_id` int(11) DEFAULT NULL COMMENT '考试id  唯一',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id    唯一',
  `qu_id` int(11) DEFAULT NULL COMMENT '题目id    唯一',
  `create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间    YYYY-MM-DD hh:mm:ss',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_user_book
-- ----------------------------
BEGIN;
INSERT INTO `t_user_book` (`id`, `exam_id`, `user_id`, `qu_id`, `create_time`) VALUES (1, 1, 164, 1, '2025-03-23 17:59:29');
COMMIT;

-- ----------------------------
-- Table structure for t_user_daily_login_duration
-- ----------------------------
DROP TABLE IF EXISTS `t_user_daily_login_duration`;
CREATE TABLE `t_user_daily_login_duration` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键，自增长',
  `user_id` int(11) DEFAULT NULL COMMENT '用户ID，与用户表关联，确保数据一致性',
  `login_date` date DEFAULT NULL COMMENT '登录日期，记录用户在哪一天的登录时长',
  `total_seconds` int(11) DEFAULT NULL COMMENT '累积在线秒数，每日登录总时长，单位为秒',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=135 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of t_user_daily_login_duration
-- ----------------------------
BEGIN;
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (126, 164, '2025-03-22', 0);
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (127, 164, '2025-03-23', 109330);
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (128, 164, '2025-03-25', 893);
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (129, 164, '2025-03-27', 0);
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (130, 164, '2025-04-02', 504567);
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (131, 164, '2025-04-04', 171621);
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (132, 164, '2025-04-05', 38307);
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (133, 164, '2025-04-06', 125805);
INSERT INTO `t_user_daily_login_duration` (`id`, `user_id`, `login_date`, `total_seconds`) VALUES (134, 164, '2025-04-18', 1026769);
COMMIT;

-- ----------------------------
-- Table structure for t_user_exams_score
-- ----------------------------
DROP TABLE IF EXISTS `t_user_exams_score`;
CREATE TABLE `t_user_exams_score` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id  用户考试成绩表',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id  唯一',
  `exam_id` int(11) DEFAULT NULL COMMENT '试卷id  唯一',
  `total_time` int(11) DEFAULT NULL COMMENT '总时长  YYYY-MM-DD hh:mm:ss',
  `user_time` int(11) DEFAULT NULL COMMENT '用户用时  YYYY-MM-DD hh:mm:ss',
  `user_score` int(10) unsigned DEFAULT '0' COMMENT '用户得分',
  `limit_time` datetime DEFAULT NULL COMMENT '交卷时间  YYYY-MM-DD hh:mm:ss',
  `count` int(11) DEFAULT '0' COMMENT '切屏次数',
  `state` int(11) DEFAULT NULL COMMENT '状态   0正在考试 1考试完成',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间  YYYY-MM-DD hh:mm:ss',
  `whether_mark` int(11) DEFAULT NULL COMMENT '是否阅卷-1无简答题、0未阅卷、1阅卷',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `user_id` (`user_id`,`exam_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_user_exams_score
-- ----------------------------
BEGIN;
INSERT INTO `t_user_exams_score` (`id`, `user_id`, `exam_id`, `total_time`, `user_time`, `user_score`, `limit_time`, `count`, `state`, `create_time`, `whether_mark`) VALUES (1, 164, 1, 100, 9, 0, '2025-03-23 17:59:29', 0, 1, '2025-03-23 17:59:19', -1);
INSERT INTO `t_user_exams_score` (`id`, `user_id`, `exam_id`, `total_time`, `user_time`, `user_score`, `limit_time`, `count`, `state`, `create_time`, `whether_mark`) VALUES (2, 164, 4, 100, 8, 5, '2025-03-23 18:01:24', 0, 1, '2025-03-23 18:01:15', -1);
COMMIT;

-- ----------------------------
-- Table structure for t_user_exercise_record
-- ----------------------------
DROP TABLE IF EXISTS `t_user_exercise_record`;
CREATE TABLE `t_user_exercise_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id   用户刷题记录表',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `repo_id` int(11) DEFAULT NULL COMMENT '题库id',
  `total_count` int(11) DEFAULT NULL COMMENT '总题数',
  `exercise_count` int(11) DEFAULT NULL COMMENT '已刷题数',
  `create_time` datetime DEFAULT NULL COMMENT '刷题时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_user_exercise_record
-- ----------------------------
BEGIN;
INSERT INTO `t_user_exercise_record` (`id`, `user_id`, `repo_id`, `total_count`, `exercise_count`, `create_time`) VALUES (1, 164, 1, 1, 5, '2025-03-23 17:59:08');
COMMIT;

-- ----------------------------
-- Table structure for t_user_grade
-- ----------------------------
DROP TABLE IF EXISTS `t_user_grade`;
CREATE TABLE `t_user_grade` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `u_id` int(11) DEFAULT NULL COMMENT '用户id',
  `g_id` int(11) DEFAULT NULL COMMENT '教师id',
  `is_deleted` int(11) DEFAULT '0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of t_user_grade
-- ----------------------------
BEGIN;
INSERT INTO `t_user_grade` (`id`, `u_id`, `g_id`, `is_deleted`) VALUES (10, 163, 124, 0);
COMMIT;

-- ----------------------------
-- Table structure for t_user_job_details
-- ----------------------------
DROP TABLE IF EXISTS `t_user_job_details`;
CREATE TABLE `t_user_job_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `content` text COMMENT '用户回答内容',
  `job_id` int(11) NOT NULL COMMENT '所属作业',
  `score` double DEFAULT NULL COMMENT '用户分数',
  `state` int(11) NOT NULL COMMENT '回答状态0未打分1打分',
  `is_deleted` int(11) DEFAULT '0' COMMENT '逻辑删除字段',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of t_user_job_details
-- ----------------------------
BEGIN;
INSERT INTO `t_user_job_details` (`id`, `content`, `job_id`, `score`, `state`, `is_deleted`, `create_time`, `user_id`) VALUES (5, '<p>测试<img src=\"http://127.0.0.1:9000/online-exam/8754cf28-fc9b-4f29-9436-e25b2c75b191.png\"></p>', 5, 10, 1, 0, '2025-04-06 20:09:47', 164);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
